package com.jianan.mis.data.domain.base;

import java.io.Serializable;


/**
 * This is an object that contains data related to the group_view table.
 * Do not modify this class because it will be overwritten if the configuration file
 * related to this class is modified.
 *
 * @hibernate.class
 *  table="group_view"
 */

public abstract class BaseGroupView  implements Serializable {

	public static String REF = "GroupView";


	// constructors
	public BaseGroupView () {
		initialize();
	}

	/**
	 * Constructor for primary key
	 */
	public BaseGroupView (
		com.jianan.mis.data.domain.View viewid,
		com.jianan.mis.data.domain.Group groupid) {

		this.setViewid(viewid);
		this.setGroupid(groupid);
		initialize();
	}

	protected void initialize () {}



	private int hashCode = Integer.MIN_VALUE;

	// primary key

	private com.jianan.mis.data.domain.View viewid;

	private com.jianan.mis.data.domain.Group groupid;



	/**
     * @hibernate.property
     *  column=viewid
	 * not-null=true
	 */
	public com.jianan.mis.data.domain.View getViewid () {
		return this.viewid;
	}

	/**
	 * Set the value related to the column: viewid
	 * @param viewid the viewid value
	 */
	public void setViewid (com.jianan.mis.data.domain.View viewid) {
		this.viewid = viewid;
		this.hashCode = Integer.MIN_VALUE;
	}

	/**
     * @hibernate.property
     *  column=groupid
	 * not-null=true
	 */
	public com.jianan.mis.data.domain.Group getGroupid () {
		return this.groupid;
	}

	/**
	 * Set the value related to the column: groupid
	 * @param groupid the groupid value
	 */
	public void setGroupid (com.jianan.mis.data.domain.Group groupid) {
		this.groupid = groupid;
		this.hashCode = Integer.MIN_VALUE;
	}





	public boolean equals (Object obj) {
		if (null == obj) return false;
		if (!(obj instanceof com.jianan.mis.data.domain.GroupView)) return false;
		else {
			com.jianan.mis.data.domain.GroupView groupView = (com.jianan.mis.data.domain.GroupView) obj;
			if (null != this.getViewid() && null != groupView.getViewid()) {
				if (!this.getViewid().equals(groupView.getViewid())) {
					return false;
				}
			}
			else {
				return false;
			}
			if (null != this.getGroupid() && null != groupView.getGroupid()) {
				if (!this.getGroupid().equals(groupView.getGroupid())) {
					return false;
				}
			}
			else {
				return false;
			}
			return true;
		}
	}

	public int hashCode () {
		if (Integer.MIN_VALUE == this.hashCode) {
			StringBuilder sb = new StringBuilder();
			if (null != this.getViewid()) {
				sb.append(this.getViewid().hashCode());
				sb.append(":");
			}
			else {
				return super.hashCode();
			}
			if (null != this.getGroupid()) {
				sb.append(this.getGroupid().hashCode());
				sb.append(":");
			}
			else {
				return super.hashCode();
			}
			this.hashCode = sb.toString().hashCode();
		}
		return this.hashCode;
	}


	public String toString () {
		return super.toString();
	}


}